package TAIC.IPLM ; 
import java.io.* ;
import java.util.* ;

public class Tester {
	
	static public void main ( String s [] ) {
		int webStart , webEnd , trainStart, trainEnd , Iteration , testImage , keys ;
		int i, j ;
		String dir ; 
		keys = 2 ; 
		try {
			Scanner scanner = new Scanner ( new File ( "test.conf" ) ) ;
			dir = scanner.next() ;
			File tempFile = new File ( "result\\" + dir + "\\" ) ;
			if ( !tempFile.exists() ) tempFile.mkdirs () ;
			scanner.next() ;
			webStart = scanner.nextInt () ;
			webEnd = scanner.nextInt () ;
			scanner.next() ; 
			trainStart = scanner.nextInt() ;
			trainEnd = scanner.nextInt () ;
			scanner.next();
			testImage = scanner.nextInt();
			scanner.next() ;
			Iteration = scanner.nextInt() ;
			scanner.next() ;
			keys = scanner.nextInt() ; 
		
		PrintStream fout = null;
		if ( s.length == 0 ) fout = System.out ;
		else try{
			fout = new PrintStream ( new File ( s[ 0 ] ) ) ;
		}catch ( Exception e ) {
			e.printStackTrace () ;
		}
		fout.println ( (webEnd - webStart + 1) + " " + (trainEnd - trainStart + 1 ) ) ;
		TestResult testResult  ;
		DataGen dataGen = new DataGen () ; 
			for ( i = webStart ; i <= webEnd ; i ++ ) 
				for ( j = trainStart ; j <= trainEnd ; j ++ ) {
					testResult = dataGen.test( i , j , keys , testImage, Iteration , "result\\" + dir + "\\") ; 
					fout.println ( testResult.average + " " + testResult.deviation ) ; 
				}
		}
		catch ( Exception e ) {
			e.printStackTrace () ;
		}
	}
	
	
}